<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/login.css">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(function(){
		$(".logbtn").click(function(){
			checkLogin();
		});
		
		function checkLogin(){
			var $username = $("#username").val();
			var $password = $("#password").val();
			if($username==null||$username.trim()==""){
				$("#passwordMessage").hide();
				$("#usernameMessage").show();
				return false;
			}
			if($password==null||$password.trim()==""){
				$("#usernameMessage").hide();
				$("#passwordMessage").show();
				return false;
			}
			$("form").submit();
		}
	});
</script>
</head>
<body>
	<div class="container">
		<div class="img">
			<img src="${pageContext.request.contextPath }/img/default.jpg">
		</div>
	
		<div class="log">
			<form action="login" method="post"">
				<ul>
					<ol><input class="input" type="text" placeholder="  用户名" id="username" name="username"/>
						<c:if test="${message!=null }">
							<span style="color: red">${message }</span>
						</c:if>
						<div id="usernameMessage" style="color: red;display: none;margin-top: 5px;">用户名不能为空</div>
					</ol>
					<ol><input class="input" type="password" placeholder="  密码" id="password" name="password"/>
						<div id="passwordMessage" style="color: red;display: none;margin-top: 5px;">密码不能为空</div>
					</ol>
					<ol><div class="logbtn">登陆</div></ol>
				</ul>
			</form>
		</div>
	</div>
</body>
</html>